package com.park.common.empty;

import java.util.Collection;

/**
 * @author daihuajun
 *	集合和字符串非空和空的判断
 */
public class EmptyUtils {
	
	private EmptyUtils(){}
	/**
	 * 判断集合为空
	 * @param str
	 * @return
	 */
	public static boolean isEmpty(Collection<?> collection){
		return !isNotEmpty(collection);
	}
	
	/**
	 * 判断集合不为空
	 * @param str
	 * @return
	 */
	public static boolean isNotEmpty(Collection<?> collection){
		return (collection != null && !collection.isEmpty());
	}
	
	/**
	 * 判断字符串为空
	 * @param str
	 * @return
	 */
	public static boolean isEmpty(String str){
		return !isNotEmpty(str);
	}
	
	/**
	 * 判断字符串不为空
	 * @param str
	 * @return
	 */
	public static boolean isNotEmpty(String str){
		return (str != null && !str.isEmpty() && !"".equals(str));
	}
	
}
